images_array = ["idl_plots/dispersion_day/o_beam20170406_180000_to_20170407_000000_dispersion.png"
,"idl_plots/dispersion_day/o_beam20170817_120000_to_20170817_180000_dispersion.png"]
ipyplot.plot_images(images_array, img_width=350)
display_array = []
for i in toplot.index:
display_array = []
i_toplot = toplot.loc[i,:]
match_date = lambda x: (i_toplot['date'][0:4]+i_toplot['date'][5:7]+i_toplot['date'][8:10]) in x
match_list1 = list(map(match_date, dispersion_tplot_list))
if match_list1.count(True) > 0:
index1 = match_list1.index(True)
i_tplot1 = dispersion_tplot_list[index1]
display_array.append(i_tplot1)
match_list2 = list(map(match_date, dispersion_fitting_plot_list))
if match_list2.count(True) > 0:
index2 = match_list2.index(True)
i_tplot2 = dispersion_fitting_plot_list[index2]
display_array.append(i_tplot2)
ipyplot.plot_images(display_array, img_width=400)
# display(Image(url = display_array[0]))
i=0
fig = px.scatter(dispersion_list_m_merged, x="RE", y="estimated_distance_m", trendline="ols", color = "good_fit", size="Duration", hover_name="Event Time")
reference_line = go.Scatter(x=[0, 35], y=[0, 35], mode="lines", line=go.scatter.Line(color="gray"), showlegend=False)
fig.add_trace(reference_line)
fig.update_layout( title = 'Replicate manual identification',font=dict( family="Courier New, monospace",size=18 ), legend_x = 0, legend_y=1)
fig = px.scatter(dispersion_list_m_merged.loc[index,], x="estimated_distance_m", y="estimated_distance"
, hover_name="Event Time" ,size="Duration", trendline="ols"
, hover_data = ["index", "BETA", "direction", "GSM_Z", "p_value", 'GSM_X', 'BX_GSM']
, color = "good_fit"
)
reference_line = go.Scatter(x=[0, 35], y=[0, 35], mode="lines", line=go.scatter.Line(color="gray"), showlegend=False)
fig.add_trace(reference_line)
fig.update_layout(title = 'Comparison of estimated distance (auto vs manual)' ,
font=dict(family="Courier New, monospace",size=18 ), legend_x = 1, legend_y=1)
fig = px.scatter(dispersion_list_m_merged.loc[index,], x="model_field_line_length_idl", y="estimated_distance_m"
, size="Duration"
, hover_name="Event Time"
, hover_data = ["index", "BETA", "direction", "GSM_Z", "p_value", 'GSM_X', 'BX_GSM']
, trendline="ols"
, color = "good_fit"
)
reference_line = go.Scatter(x=[0, 35], y=[0, 35], mode="lines", line=go.scatter.Line(color="gray"), showlegend=False)
fig.add_trace(reference_line)
fig.update_layout(title = 'Manual estiamted distance VS traced field line length ('+model+')' ,
font=dict(family="Courier New, monospace",size=18 ), legend_x = 0, legend_y=1)
fig.show()
fig = px.scatter(dispersion_list_m_merged.loc[index,], x="model_field_line_length_idl", y="estimated_distance", size="dispersion_time", hover_name="TIME", hover_data = ["index", "BETA", "direction", "GSM_Z", "p_value", 'GSM_X', 'BX_GSM']
, trendline="ols", color = "good_fit")
reference_line = go.Scatter(x=[0, 35], y=[0, 35], mode="lines", line=go.scatter.Line(color="gray"), showlegend=False)
fig.add_trace(reference_line)
fig.update_layout(title = 'Auto estiamted distance VS traced field line length ('+model+')', font=dict(family="Courier New, monospace",size=18), legend_x = 0, legend_y=1)
fig = px.scatter(dispersion_list_m_merged.loc[index,:], x="model_field_line_length_idl", y="estimated_distance_m"
, size="dispersion_time"
, hover_name="datetime_str"
, hover_data = ["index", "BETA", "direction", "GSM_Z", "p_value", 'GSM_X', 'BX_GSM','MLT_y']
, trendline="ols"
, symbol = "direction_et"
# , facet_col="direction_et"
# , facet_row="region"
, color = "region" #np.log10(dispersion_list_m_merged.loc[index,"mean_E"]), range_color=[3,5]
)
reference_line = go.Scatter(x=[0, 35], y=[0, 35], mode="lines", line=go.scatter.Line(color="gray"), showlegend=False)
fig.add_trace(reference_line)
#fig.add_trace(reference_line, row=1, col=1)
#fig.add_trace(reference_line, row=1, col=2)
fig.update_layout(#title = ' ' + ', goodness of fit > ' + str(goodness_of_fit_threshold),
font=dict(
family="Courier New, monospace",
size=18 ), legend_x = 1, legend_y=1)
fig.update_layout(coloraxis_colorbar=dict(
title="energy",
tickvals=[1,2,3,4,5],
ticktext=["10", "100", "1k","100k","100k"],
))